# -*- coding: utf-8 -*-
""" 
@author: ertao.xyz
@create: 2021-09-25 15:00
@description: 
"""
from tortoise import fields, Model

from core.model import TimestampMixin


class Permission(Model, TimestampMixin):
    name = fields.CharField(max_length=32)
    model = fields.CharField(max_length=32, description='模块')
    act = fields.CharField(max_length=16, description='权限行为')
    remark = fields.CharField(max_length=256, description='备注', null=True)

    class Meta:
        table = "permission"
        table_description = "权限列表"
        ordering = ['-created_at']
        unique_together = ("model", "act")
